<?php
/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
require("ImbaValidator.php");
echo 'email: ';echo ImbaValidator::Validate('email', 'hikui@163.com'); echo '<br />';
echo 'email: ';echo ImbaValidator::Validate('email', 'hikui$163.com'); echo '<br />';
echo 'url: ';echo ImbaValidator::Validate('url', 'http://hikuisblog.appspot.com'); echo '<br />';
echo 'url: ';echo ImbaValidator::Validate('url', 'fuckall.cn'); echo '<br />';
echo 'numerical: ';echo ImbaValidator::Validate('numerical', '123456'); echo '<br />';
echo 'numerical: ';echo ImbaValidator::Validate('numerical', 'fda'); echo '<br />';
echo 'minlen: ';echo ImbaValidator::Validate('minlen', 'fda',2); echo '<br />';
echo 'minlen: ';echo ImbaValidator::Validate('minlen', 'fda',6); echo '<br />';
echo 'maxlen: ';echo ImbaValidator::Validate('maxlen', 'fda',6); echo '<br />';
echo 'maxlen: ';echo ImbaValidator::Validate('maxlen', 'aaaaaaaaaaa',6); echo '<br />';
echo 'date: ';echo ImbaValidator::Validate('date', '1990-2-28','ymd'); echo '<br />';
echo 'date: ';echo ImbaValidator::Validate('date', '1990-2-28'); echo '<br />';
echo 'date: ';echo ImbaValidator::Validate('date', '02-28-1990','mdy'); echo '<br />';
echo 'between: ';echo ImbaValidator::Validate('between', 'kingdom301',array(3,20)); echo '<br />';
echo 'between: ';echo ImbaValidator::Validate('between', 'kingdom301',array(3,9)); echo '<br />';
echo 'extension: ';echo ImbaValidator::Validate('extension', '/this.php',array('php','jsp','asp')); echo '<br />';
echo 'extension: ';echo ImbaValidator::Validate('extension', '/this.jsp',array('php','jsp','asp')); echo '<br />';
echo 'extension: ';echo ImbaValidator::Validate('extension', '/this.txt',array('php','jsp','asp')); echo '<br />';
echo 'custom: ';echo ImbaValidator::Validate('custom', '123456',"/\d+/"); echo '<br />';
echo 'custom: ';echo ImbaValidator::Validate('custom', 'd',"/\d+/"); echo '<br />';
?>
